<include file="Public/header"/>
<style>
    .report-file {display: block;position: relative;width: 120px;height: 34px;  		overflow: hidden;  border: 1px solid #428bca;
        background: none repeat scroll 0 0 #428bca;  color: #fff;  cursor: 			pointer;text-align: center;  float: left;
        margin-right:5px;border-radius: 3px; margin-top: 20px;}
    .report-file span {  cursor: pointer;  display: block;  line-height: 34px; }
    .file-prew {  position: absolute;  top: 0;  left:0;  width: 120px;  height: 		34px; opacity: 0;filter: alpha(opacity=0);  cursor: pointer;  }
</style>
<div class="wrapper m-t">

        <div class="panel panel-info">
            <div class="panel-heading no-padding">
                <div class="panel-options">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="{:U('SystemSet/foundation')}">微信配置</a></li>
                        <li><a href="{:U('SystemSet/companyConfig')}">公司信息</a></li>
                        <li><a href="{:U('SystemSet/bankConfig')}">银行卡信息</a></li>
                        <li><a href="{:U('SystemSet/restConfig')}">其他</a></li>
                    </ul>
                </div>
            </div>
            <div class="panel-body">
                <div class="tab-content">
                    <div id="tab-1" class="tab-pane active">
                        <form class="form-horizontal"  method="post" action="{:U('SystemSet/updateInfo')}">
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">公众号名：</label>
                                <div class="col-lg-5">
                                    <input type="text" name="wechatName" class="form-control" value="{$vo.wechatname}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">微信公众号名称</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">微信AppID：</label>
                                <div class="col-lg-5">
                                    <input type="text" disabled name="appid" class="form-control" value="{$vo.appid}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">微信appid</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">微信密匙：</label>
                                <div class="col-lg-5">
                                    <input type="text" disabled name="appsecret" class="form-control" value="{$vo.appsecret}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">用于开发微信高级功能的密匙</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">原始id：</label>
                                <div class="col-lg-5">
                                    <input type="text" disabled name="openid" class="form-control" value="{$vo.openid}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">微信公众号原始id</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">服务器地址：</label>
                                <div class="col-lg-5">
                                    <input disabled type="text"  class="form-control" value="{$vo.severurl}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">微信API接口地址</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">API token：</label>
                                <div class="col-lg-5">
                                    <input type="text" disabled name="token" class="form-control" value="{$vo.token}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">微信API接口的token</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">随机数：</label>
                                <div class="col-lg-5">
                                    <input type="text" disabled name="encodingaeskey" class="form-control" value="{$vo.encodingaeskey}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">微信API接口的43位随机数</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">二维码：</label>

                                <div class="col-lg-5">
                                    <div class="col-lg-4">
                                        <img id="codeimg" width="120px" height="120px" src="{$vo.qrcode}"/>
                                    </div>

                                    <div class="col-lg-4">
                                        <div class="report-file">
                                            <span>上传二维码</span>
                                            <input type="file" onchange="ajaxFileUpload()" name="headimgurl" id="file0" class="file-prew">
                                        </div>
                                    </div>

                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">公众号二维码</span>
                                </div>
                            </div>
                            <input type="hidden" id="QRcode" name="QRcode" value="{$vo.qrcode}"/>
                            <div class="form-group">
                                <label class="col-lg-3 control-label"></label>
                                <div class="col-lg-8">
                                    <input type="submit" target-form="form-horizontal" class="btn btn-primary m-r col-lg-2 ajax-post" value="确定"/>
                                    <input type="button" class="btn btn-info col-lg-2" onclick="javascript:history.back(-1);return false;" value="返回"/>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
</div>
<include file="Public/footer"/>
<script src="__PUBLIC__/Static/js/ajaxfileupload.js"></script>

<script>
    //异步图片上传
    function ajaxFileUpload() {
        $.ajaxFileUpload({
            url: "{:U('Mobile/Wap/touxiang')}", //用于文件上传的服务器端请求地址
            secureuri: false, //是否需要安全协议，一般设置为false
            fileElementId: 'file0', //文件上传域的ID
            dataType: 'json', //返回值类型 一般设置为json
            async:false,
            success: function (data, status){ //服务器成功响应处理函数
                        console.log(data);
                if(data.state=='success'){
                    $("#codeimg").attr('src',data.info);
                    $("#QRcode").val(data.info);

                }else{
                    alert('上传失败');
                }
            },
            error: function (data, status, e){ //服务器响应失败处理函数
                alert(e);
            }
        })
        return false;
    }




</script>
